import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);
import maoFunc from '@/mao-ui/library/function.js';
import config from '@/mao-ui/config';

var maoData = maoFunc.getMaoData();
maoData = maoFunc.mergingArrays(maoData, config);

const store = new Vuex.Store({
	state:maoData,
	mutations:{
		setConfig: (store, option) => {
			store[option.name] = option.value;
			if(option.forever === true){
				maoFunc.setMaoData(option.name, option.value);
			}
		}
	}
})

export default store